home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / intrfc70.zip / NAMETYPE.PAS < prev    next >
Pascal/Delphi Source File  |  1994-03-16  |  5KB  |  190 lines

  1. unit nametype;
  2. {$I SWITCHES.INC}
  3. { Unit of type/const definitions for namelist unit }
  4.  
  5. interface
  6. type
  7.  
  8.   tbyteset = set of byte;
  9.  
  10. {$IFDEF UNIT60}
  11.   type_def_ptr = ^type_def_rec;
  12.   type_def_rec = record
  13.     type_type : byte;
  14.     other_byte : byte;
  15.     size : word;
  16.     base_type : word;
  17.     case integer of
  18.     1 : ( element_ofs,element_unit,index_ofs,index_unit: word );
  19.     2 : ( hash_ofs, first_ofs :word;
  20.   {3}     parent_ofs, parent_unit, vmt_size :word;
  21.   {3}     handle,w10,self_type_ofs : word );
  22.     7 : ( base_ofs,base_unit:word );
  23.     6 : ( return_ofs,return_unit,num_args:word );
  24.     8 : ( target_ofs,target_unit:word );
  25.    15 : ( lower,upper : longint;
  26.           type_ofs,type_unit:word
  27.         );
  28.    -1 : ( who_knows : array[3..8] of word
  29.         );
  30.   end;
  31. {$ELSE}
  32.   { BP 7.0 }
  33.   type_def_ptr = ^type_def_rec;
  34.   type_def_rec = record
  35.     type_type : byte;
  36.     other_byte : byte;
  37.     size : word;
  38.     owner : word;
  39.     base_type : word;
  40.     case integer of
  41.     1 : ( element_ofs,element_unit,index_ofs,index_unit: word );
  42.     2 : ( hash_ofs, first_ofs :word;
  43.   {3}     parent_ofs, parent_unit, vmt_size :word;
  44.   {3}     handle,w10,self_type_ofs,previous_object_def : word );
  45.     7 : ( base_ofs,base_unit:word );
  46.     6 : ( return_ofs,return_unit,num_args:word );
  47.     8 : ( target_ofs,target_unit:word );
  48.    15 : ( lower,upper : longint;
  49.           type_ofs,type_unit:word
  50.         );
  51.    -1 : ( who_knows : array[3..8] of word
  52.         );
  53.   end;
  54. {$ENDIF}
  55.  
  56.   type_info_ptr = ^type_info_rec;
  57.   type_info_rec = record
  58.     type_def_ofs,type_unit : word;
  59.   end;
  60.  
  61.   var_flags = set of (const_flag,      { initialized data }
  62.                       local,           { on the stack     }
  63.                       referenced,      { var parameter    }
  64.                       field,           { field of a record or object }
  65.                       absolute,        { declared absolute something else }
  66.                       argument,        { an argument to the func/proc }
  67.                       const_arg,       { constant argument }
  68.                       v128);
  69.  
  70.   var_info_ptr = ^var_info_rec;
  71.   var_info_rec = record
  72.     flags : var_flags;
  73.     offset,  { within the appropriate section }
  74.     in_unit, { either unit number if absolute, or data block number }
  75. {$IFNDEF UNIT60}
  76.     next_field, { next fiels in record etc. }
  77. {$ENDIF}
  78.     type_def_ofs,type_unit : word;
  79.   end;
  80.  
  81.   const_info_ptr = ^const_info_rec;
  82.   const_info_rec = record
  83.     type_def_ofs,type_unit : word;
  84.     case integer of
  85.     -1: (allval:byte);
  86.     0:  (intval:longint);
  87.     1:  (realval:real);    { never used? }
  88.     2:  (stringval:string);
  89.     3:  (extendval:extended);
  90.     4:  (boolval:boolean);
  91.     5:  (charval:char);
  92.     6:  (ptrval:pointer);
  93.     7:  (setval:tbyteset);
  94.     end;
  95.  
  96.   arg_ptr = ^arg_rec;
  97.   arg_rec = record
  98.     type_def_ofs,type_unit : word;
  99.     flags : var_flags;
  100.   end;
  101.  
  102.   func_type_ptr = ^func_type_rec;
  103.   func_type_rec = record
  104.     type_def_ofs,type_unit,num_args : word;
  105.   end;
  106.  
  107.   code_flags = set of (far_entry,inline_code,interrupt,external_code,method,construct,
  108.                        destruct,assembler);
  109. {$IFDEF UNIT60}
  110.   obj_flags  = set of (exported,windows_frame,from_dll,by_name,
  111.                        dynamic,local_code,f40,f80);
  112. {$ELSE}
  113.   obj_flags  = set of (exported,windows_frame,dynamic,not_from_dll,
  114.                        f10,f20,f40,f80);
  115. {$ENDIF}
  116.   func_info_ptr = ^func_info_rec;
  117.   func_info_rec = record
  118.     code_type:code_flags;
  119.     obj_type :obj_flags;
  120.     entry_ofs,parent_ofs,local_hash,vmt_entry,
  121. {$IFNDEF UNIT60}
  122.     w4,w5,w6,
  123.     next_method:word;
  124. {$ELSE}
  125.     next_method,w6,w7:word;
  126. {$ENDIF}
  127.     func_type : func_type_rec;
  128.   end;
  129.  
  130.   system_info_ptr = ^system_info_rec;
  131.   system_info_rec = record
  132.     addr_ofs, flags : byte;
  133.   end;
  134.  
  135.  
  136. const
  137.   record_id   =  2;
  138.   object_id   =  3;
  139.   objpriv_id  =  4;
  140. {$IFDEF UNIT60}
  141.   const_id     = 80;
  142.   type_id      = 81;
  143.   var_id       = 82;
  144.   proc_id      = 83;
  145.   sys_proc_id  = 84;
  146.   sys_fn_id    = 85;
  147.   sys_new_id   = 86;
  148.   sys_port_id  = 87;
  149.   sys_mem_id   = 88;
  150.   unit_id      = 89;
  151. {$ELSE}
  152.   {BP 7.0}
  153.   const_id     = $4f;
  154.   type_id      = $50;
  155.   var_id       = $51;
  156.   proc_id      = $52;
  157.   unit_id      = $53;
  158.  
  159.   sys_proc_id  = $56;
  160.   sys_fn_id    = $57;
  161.   sys_new_id   = $58;
  162.   sys_port_id  = $59;
  163.   sys_mem_id   = $5a;
  164.   sys_openstr_id = $5b;
  165. {$ENDIF}
  166.   init_id     = 128;   { Just hope that these haven't already been taken! }
  167.   uses_id     = 129;
  168.   local_id    = 130;
  169.   referenced_id = 131;
  170.   refconst_id = 132;
  171.  
  172. var
  173.   known_types : tbyteset;
  174.  
  175.   dump_types  : tbyteset;
  176.  
  177. implementation
  178.  
  179. begin
  180.   known_types :=   [var_id,unit_id,const_id,type_id,proc_id,
  181.                     sys_proc_id,sys_fn_id,sys_mem_id,sys_port_id,
  182.                     sys_new_id
  183. {$IFNDEF UNIT60}
  184.                     ,sys_openstr_id
  185. {$ENDIF}
  186.                     ];
  187.  
  188.   dump_types  :=   [0..255] - known_types;
  189. end.
  190.